<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>活动详情</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="email=no"/>
<meta name="format-detection" content="address=no"/>
<link href="__PUBLIC__/css/base.css" rel="stylesheet"/>
</head>
<body class="huibg">
<!---  头部开始  -->
<div class="top clearfix">
	<div class="icon_left"></div>
	<div class="icon_right"></div>
</div>
<!---  头部结束  -->
<div class="fbbl actity_info cssss">
	<div class="box">
		<div class="title_02">活动信息</div>
		<div class="box_04">
			<b>活动类型：</b>
			<span>
				<if condition="$event['isonline'] eq 1">
					线上活动
				<else />
					线下活动
				</if>
			</span>
		</div>
		<div class="box_04">
			<if condition="$event['isonline'] eq 1">
				<b>线上活动链接：</b>
				<span>{$event.eventlink}</span>
			<else />
				<b>线下活动地点：</b>
				<span>{$event.location}</span>
			</if>
		</div>
	</div>
	<div class="box">
		<div class="box_04">
			<b>活动费用：</b>
			<if condition="$event.price eq 0">
				<span>免费</span>
			<else />
				<span>收费</span>
			</if>
		</div>
		<div class="box_04">
			<b>收费费用：</b>
			<span>￥{$event.price}.00</span>
		</div>
		<div class="box_04">
			<b>活动照片：</b>
			<span></span>
		</div>
		<div class="box_04 photo_list1">
			<volist name="image" id="vo">
				<a><img src="{$vo.image}" /></a>
			</volist>
		</div>
	</div>
	<div class="box">
		<div class="title_02">活动内容</div>
		<div class="box_04">
			<b>活动名称：</b>
			<span>{$event.name}</span>
		</div>
		<volist name="org" id="vo" key="k">
		<div class="box_04">
			<if condition="$k eq 1">
			<b>主办机构：</b>
			<span>{$vo.name}</span>
			<else />
			<b></b>
			<span>{$vo.name}</span>
			</if>

		</div>
		</volist>
		<div class="box_04">
			<b>活动期数：</b>
			<span>{$period}</span>
		</div>
		<div class="box_04">
			<b>活动开始时间：</b>
			<span>{$event.starttime}</span>
		</div>
		<div class="box_04">
			<b>活动结束时间：</b>
			<span>{$event.endtime}</span>
		</div>
		<div class="box_04">
			<b>专业标签：</b>
			<span>{$event.major}</span>
		</div>
		<div class="box_04">
			<b>学分明细：</b>
			<span>{$event.partitions}</span>
		</div>
		<div class="box_04">
			<b>参与人员限额：</b>
			<span>{$event.membercount}人</span>
		</div>
		<div class="box_04">
			<b>报名条件：</b>
			<span>{$event.conditions|nl2br}</span>
		</div>	
		<div class="box_04">
			<b>活动简介：</b>
			<span>{$event.description|nl2br}</span>
		</div>	
		<div class="box_04">
			<b>日程安排：</b>
			<span>{$event.schedule|nl2br}</span>
		</div>
		<div class="box_04">
			<b>交通食宿安排：</b>
			<span>{$event.traffic|nl2br}</span>
		</div>
		<div class="box_04">
			<b>联系人与电话，邮箱：</b>
		</div>
		<volist name="contact" id="vo">
		<div class="box_05">
			<p><span>联系人：</span><span>{$vo.name}</span></p>
			<p><span>电&nbsp;&nbsp;&nbsp;话：</span><span>{$vo.mobile}</span></p>
			<p><span>邮&nbsp;&nbsp;&nbsp;箱：</span><span>{$vo.email}</span></p>
		</div>
		</volist>	
		<div class="box_04">
			<b>特别提示：</b>
			<span>{$event.tips|nl2br}</span>
		</div>
	</div>
	<div class="box bd0">
		<div class="title_01">
			<span>评论</span>
			<i></i>
		</div>
		<div class="tab_box shou">
			<table class="tab_01">
				<tbody>
			</tbody></table>			
		</div>
	</div>	
	<a class="more">查看更多</a>
	<div class="huibg">
		<p class="title3">恳请您的评论与点赞：</p>
		<textarea name="disscuss" class="textarea1" placeholder="亲，我们邀请您也来写评论哦！来写吧~" cols="30" rows="10"></textarea>
		<p>
			<a class="dz <if condition="$praise eq 0">check</if>">
				<i onclick = "recpraise({$event.id});"></i>
				<span>{$event.praise}</span>
			</a>
			<a class="disscuss">发表评论</a>
		</p>
	</div>
	<div class="bott2">
		<a class="yes join_act">我要参加</a>
	</div>
</div>
<!---  我要参加 提示框开始  -->
<div class="reminder_box join_box none">
	<div class="reminderBox_bg"></div>
	<div class="reminderBox_text">
		<p>亲，这么重要的活动可惜了~</p>
		<p>人数已满，很抱歉您不能参加此次活动了。感谢您的参与，谢谢您的理解~</p>
		<p>您也可以联系客服，了解具体事宜。</p>
		<p class="texcen"><a class="iKnow" id="iknow"><span>知道了</span></a></p>
	</div>
</div>
<!---  我要参加 提示框结束  -->
<!---  退费 提示框开始  -->
<div class="reminder_box return1 none">
	<div class="reminderBox_bg"></div>
	<div class="reminderBox_text">
		<p>亲，这么重要的活动珍惜不珍惜？您真的要取消吗？~</p>
		<p>如确认退出活动，我们将会在5个工作日内退还您所支付的费用；如有问题请联系客服~</p>
		<p>
			<a class="invite2"><span>确定</span></a>
			<a class="confirm2"><span>取消</span></a>
		</p>
	</div>
</div>
<!---  退费 提示框结束  -->
</body>
<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/js/comm.js"></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
var eventid = {$event.id};
var reg = {$reg};//报名参与的状态
var url ='http://www.denbox.cn/DenboxWeb/wechat.php?s=/Index/bl_info/id/'+eventid;
var imgurls="http://www.denbox.cn/DenboxWeb/Public/img/base/icon.jpg";
var title='{$event.name}';
if(title==""){
	title="分享活动";
}
$(function(){
	if(reg==1){				//我要参加
		$(".join_act").html("我要参加");
	}else if(reg==2){		//现金金豆退款
		$(".join_act").html("我要退费");
	}else if(reg==3){		//等额抵扣金豆退款
		$(".join_act").html("我要退费");
	}else if(reg==4){		//免费退出报名
		$(".join_act").html("退出报名");
	}else if(reg==5){		//报名已结束
		$(".join_act").html("报名已结束");
	}else if(reg==6){		//名额已满
		$(".join_act").html("名额已满");
	}else if(reg==7){
		$(".join_act").html("活动已结束");
	}
});
wx.config({
    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
    appId: '{$appid}', // 必填，公众号的唯一标识
    timestamp: {$timestamp} , // 必填，生成签名的时间戳
    nonceStr: '{$nonceStr}', // 必填，生成签名的随机串
    signature: '{$signature}',// 必填，签名，见附录1
    	jsApiList: [
		'uploadImage',
		'chooseImage',
		'checkJsApi',
		'previewImage',
		'onMenuShareAppMessage',
        'onMenuShareTimeline',
        'onMenuShareQQ',
        'onMenuShareWeibo'
	] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
});
var image = [<volist name="image" id="vo">"http://www.denbox.cn/DenboxWeb/{$vo.image}",</volist>];
wx.ready(function(){
  	$(".photo_list1 > a").click(function(){
  		wx.previewImage({
		    current: image[0], // 当前显示图片的http链接
		    urls: image // 需要预览的图片http链接列表
		});
  	});
  // 2. 分享接口
  // 2.1 监听“分享给朋友”，按钮点击、自定义分享内容及分享结果接口
    wx.onMenuShareAppMessage({
      title: title,
      desc: "口腔行业参与者互动平台。口腔医生病例分享，订阅，专家点评；口腔圈活动参与。",
      link: url,
      imgUrl: imgurls,
      trigger: function (res) {
      },
      success: function (res) {
      	$.post('__URL__/wxshare',{type:1,id:eventid},function(e){
      	})
      },
      cancel: function (res) {
      },
      fail: function (res) {
      }
    });
  // 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
  //document.querySelector('#onMenuShareTimeline').onclick = function () {
    wx.onMenuShareTimeline({
      title: title,
      link: url,
      imgUrl: imgurls,
      trigger: function (res) {
      },
      success: function (res) {
      	$.post('__URL__/wxshare',{type:1,id:eventid},function(e){
      	})
      },
      cancel: function (res) {
      },
      fail: function (res) {
      }
    });

  // 2.3 监听“分享到QQ”按钮点击、自定义分享内容及分享结果接口
    wx.onMenuShareQQ({
      title: title,
      desc: "口腔行业参与者互动平台。口腔医生病例分享，订阅，专家点评；口腔圈活动参与。",
      link: url,
      imgUrl: imgurls,
      trigger: function (res) {
      },
      complete: function (res) {
      },
      success: function (res) {
      	$.post('__URL__/wxshare',{type:2,id:eventid},function(e){
      	})
      },
      cancel: function (res) {
      },
      fail: function (res) {
      }
    });
  // 2.4 监听“分享到微博”按钮点击、自定义分享内容及分享结果接口
    wx.onMenuShareWeibo({
      title: title,
      desc: "口腔行业参与者互动平台。口腔医生病例分享，订阅，专家点评；口腔圈活动参与。",
      link: url,
      imgUrl: imgurls,
      trigger: function (res) {
      },
      complete: function (res) {
      },
      success: function (res) {
      	$.post('__URL__/wxshare',{type:1,id:eventid},function(e){
      	})
      },
      cancel: function (res) {
      },
      fail: function (res) {
      }
    });
});
wx.error(function(res){
	alert(res.errMsg);
});

var pageIndex = 0;
var pageSize=5;
var new_element;
function getlist(){
	$.post('__URL__/actity_info_page',{
		eventid:eventid,
		pageIndex:pageIndex,
		pageSize:pageSize
	},function(e){
		if(null==e){
			$(".more").text('没有数据');
			return;
		}else{
			if(e.length < pageSize){
				$(".more").text('已经是最后一页');
			}
		}
		$.each(e,function(k,v){
			new_element='<tr>'+
				'<th width="15%">'+
					'<img src="'+v.image+'">'+
				'</th>'+
				'<td colspan="2">'+
					'<p>'+
						'<b>'+v.name+'</b>'+
						'<span class="time">'+v.addtime+'</span>'+
					'</p>'+
					'<p class="comment">'+v.content+'</p>'+
				'</td>'+
			'</tr>';
			$(".tab_01").append(new_element);
		});
	});
	pageIndex++;
}
$(".more").on("click",function(){
	getlist();
});
getlist();
$(".disscuss").click(function(){
	var content = $.trim($("textarea[name='disscuss']").val());
	if(!content){
		return;
	}else{
		$.post('__URL__/actity_info_discuss',{id:eventid,content:content},function(e){
			if(e.status==1){
				alert(e.msg);
				window.location.reload();
			}
			if(e.status==0){
				alert(e.msg);
				return;
			}
			if(e.status==2){
				alert(e.msg);
				window.location = '__URL__/person_info4_edit';
			}
		});
	}
});

var order_num = '{$order_num}';

$(".join_act").click(function(){
	if(reg == 1){		//我要参加
		window.location.href="__URL__/actity_join/id/"+eventid;
	} else if (reg == 2) {		//现金金豆退款
		$.post('__URL__/actity_refund',{order_num:order_num},function(e){
			if(e.status == 1){
				alert("退费成功");
				window.location.href='__URL__/actity_info/id/' + eventid;
			}else if(e.status==0){
				alert(e.msg);
			}
		});
	} else if (reg == 3) {		//等额抵扣金豆退款
		$.post('__URL__/backpoints',{order_num:order_num, type:1},function(e){
			if(e.status==1){
				alert("退费成功");
				window.location.href='__URL__/actity_info/id/' + eventid;
			}else if(e.status==0){
				alert("退费失败");
			}
		});
	} else if (reg == 4){		//免费退出报名
		$.post('__URL__/actity_free_refund',{id:eventid},function(e){
			if(e.status==1){
				alert("退出报名成功");
				window.location.href="__URL__/actity_info/id/"+eventid;
			} else if (e.status == 0){
				alert(e.msg);
			}
		});
	}else if(reg==5){		//报名已结束
	}else if(reg==6){		//名额已满
		$(".join_box").removeClass("none");
	}
});
//我要参加  我知道了
$("#iknow").click(function(){
	$(".join_box").addClass("none");
});
function recpraise(id){
	$.post('__URL__/actity_info_praise',{id:id},function(e){
		if(e.status==1){
			$(".huibg .dz").addClass('check');
			var praise = $(".huibg .dz>span").html();
			praise = parseInt(praise)+1;
			$(".huibg .dz>span").html(praise);
		}else{
			alert(e.msg);
		}
	});
}
$(".title_01").click(function(){
	if($(this).next(".tab_box").hasClass("shou")){
		$(this).find("i").addClass("check");
		$(this).next(".tab_box").removeClass("shou").addClass("none");
	}else{
		$(this).find("i").removeClass("check");
		$(this).next(".tab_box").addClass("shou").removeClass("none");
	}
})
</script>
</html>